// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 此处后端没有提供注释 POST /interface/_batch */
export async function batch1(body: API.InterfaceInfoEntity[], options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/interface/_batch', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 DELETE /interface/_delete/${param0} */
export async function delete1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.delete1Params,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/interface/_delete/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /interface/_init */
export async function init(options?: { [key: string]: any }) {
  return request<API.BaseResponseObject>('/interface/_init', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /interface/_query */
export async function query1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.query1Params,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseIPageInterfaceInfoEntity>('/interface/_query', {
    method: 'GET',
    params: {
      ...params,
      queryParamEntity: undefined,
      ...params['queryParamEntity'],
    },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 GET /interface/_query/${param0} */
export async function queryById1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryById1Params,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseInterfaceInfoEntity>(`/interface/_query/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 POST /interface/_save */
export async function save1(body: API.InterfaceInfoEntity, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/interface/_save', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 此处后端没有提供注释 PUT /interface/_update */
export async function update1(body: API.InterfaceInfoEntity, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/interface/_update', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 申请接口 GET /interface/apply/${param0}/${param1} */
export async function applyInterface(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.applyInterfaceParams,
  options?: { [key: string]: any },
) {
  const { id: param0, isAgree: param1, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(`/interface/apply/${param0}/${param1}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 导出所有接口的信息 GET /interface/export */
export async function exportInterface(options?: { [key: string]: any }) {
  return request<API.BaseResponseObject>('/interface/export', {
    method: 'GET',
    ...(options || {}),
  });
}

/** Api接口调用 POST /interface/invoke */
export async function apiInvoke(body: API.StarryApiRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseString>('/interface/invoke', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 根据Id查询接口 GET /interface/query/${param0} */
export async function queryInterfaceById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryInterfaceByIdParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseInterfaceInfoEntity>(`/interface/query/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 分页查询接口调用情况 POST /interface/query/count/page */
export async function queryInvokeCountByPage(
  body: API.QueryCountRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageInterfaceInfoVO>('/interface/query/count/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询接口 POST /interface/query/page */
export async function queryInterfaceByPage(
  body: API.QueryInterfaceRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponsePageInterfaceInfoEntity>('/interface/query/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增接口 POST /interface/save */
export async function saveInterface(
  body: API.InterfaceInfoEntity,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/interface/save', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
